<?php

namespace App\Models\Rooms;

use App\Models\Members;
use App\Models\Rooms\RoomGoods;
use Illuminate\Database\Eloquent\Model;

class Room extends Model
{
    protected $table = 'rooms';

    protected $fillable = [
        'room_name','max_number','room_password','type','member_id','number_of_quiz','room_num'
    ];

    protected $hidden = ['room_password'];

    public function roomgoods()
    {
        return $this->hasMany(RoomGoods::class,'room_id','id');
    }

    public function member()
    {
        return $this->hasOne(Members::class,'id','member_id');
    }
}
